<template>
  <el-container class="collagenHeight" direction="horizontal">
    <el-aside width="auto" class="my_backColor">
      <!-- 侧边导航 -->
      <common-aside></common-aside>

    </el-aside>
    <el-container>
      <el-header style="padding:0px 5px">
        <!-- 引入header -->
        <CommonHeader></CommonHeader>
        <!-- tab栏 -->
        <CommonTab></CommonTab>
      </el-header>
      <el-main style="padding:0px 5px;height:100%;margin-top: 45px">

        <router-view v-if="!$route.meta.isKeepAlive && isRouterAlive"></router-view>

      </el-main>
    </el-container>
  </el-container>
</template>

<script>
  import CommonAside from "../components/CommonAside";
  import CommonHeader from "../components/CommonHeader";
  import CommonTab from "../components/CommonTab";

  export default {
    name: "Index",
    components: {
      CommonAside,
      CommonHeader,
      CommonTab
    }, provide() {
      return {
        reload: this.reload
      };
    },
    data() {
      return {
        isRouterAlive: true
      };
    },
    methods: {
      reload() {
        this.isRouterAlive = false;
        this.$nextTick(function () {
          this.isRouterAlive = true;
        });
      }
    }
  }
</script>

<style scoped>
  .collagenHeight {
    height: 100%;
  }

  .my_backColor {
    background-color: #1A1A1A;
  }


</style>
